/*************************************************
 * File name: sport_logic.h
 * Description: 业务逻辑：排序、统计、复核流程
 *************************************************/
#ifndef SPORT_LOGIC_H__
#define SPORT_LOGIC_H__

#include "sport_type.h"

/* 根据名次计算得分 */
double Logic_CalcScore(double base, int rank);

/* 三种常用排序 */
void   Logic_SortProjectById(ProjectList *head);
void   Logic_SortPlayerBySerial(PlayerList *head);
void   Logic_SortPlayerByDept(PlayerList *head);

/* 统计 */
int    Logic_StatByDept(PlayerList head, DeptStat *out_array, int max);
int    Logic_StatByProject(PlayerList head, DeptStat *out_array, int max);

/* 复核流程 */
void   Logic_ReviewApply(PlayerNode *node);
void   Logic_ReviewOpinion(PlayerNode *node, double new_score);

#endif